package com.liu.design.behavior.template;

/**
 * @author LIU
 * @version 1.0
 * @description: 定义模板
 * @date 2022/12/19 18:58
 */
public abstract class CookTemplate {
    public final void cook(){
        heating();
        addFood();
        addSalt();
        stirFry();
        end();
    }

    public void heating(){
        System.out.println("开火。。。");
    }
    //添加食材
    public abstract void addFood();

    //添加调料
    public abstract void addSalt();


    public void stirFry(){
        System.out.println("炒菜。。。");
    }

    public void end(){
        System.out.println("完成。。。");
    }
}
